#include"Task.hpp"
#include"ThreadPool.hpp"

int main()
{
    srand((unsigned int)time(nullptr));
    ThreadPool<Task>* tp = new ThreadPool<Task>;//线程池
    tp->ThreadPoolInit();//初始化线程池中的线程
    const char* op = "+-*/%";
    //不断往任务队列塞计算任务
    while(true)
    {
        sleep(1);
        int x = rand() % 100;
        int y = rand() % 100;
        int index = read() % 5;
        Task task(x, y, op[index]);
        tp->Push(task);
    }
    return 0;
}